package myenum;



public enum  EnumGenerator {
    MALE("男"),FAMALE("女");
    private final String name;
    private EnumGenerator(String name){
        this.name=name;
    }

    public String getName() {
        return name;
    }
}

class test{
    public static void main(String[] args) {
        System.out.println(EnumGenerator.MALE.getName());
        EnumGenerator[] values = EnumGenerator.values();
        for (EnumGenerator value : values) {
            System.out.println(value.getName());
            System.out.println(value.name());
            System.out.println(value.toString());
        }
        EnumGenerator male = EnumGenerator.valueOf("MALE");
        System.out.println(male.getName());

    }
}